package com.think.teaching.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import org.codehaus.jackson.annotate.JsonIgnore;

import java.io.Serializable;
import java.util.Map;

/**
 * <p>
 * 章
 * </p>
 *
 * @author think
 * @since 2020-08-12
 */
public class Chapter extends BaseModel<Chapter> {

    private static final long serialVersionUID=1L;
    
    /**
     * 目录结构
     */
    public static final int CATALOG_CHAPTER = 0;
    
    /**
     * 文章课程小节
     */
    public static final int ARTICLE_CHAPTER = 1;
    /**
     * 视频课程小节
     */
    public static final int VIDEO_CHAPTER = 2;
    /**
     * 虚拟仿真实验课程小节
     */
    public static final int VR_CHAPTER = 3;
    /**
     * 直播课程小节
     */
    public static final int LIVING_CHAPTER = 4;


    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 课程id
     */
    private Integer courseId;

    /**
     * 章节名称
     */
    private String chapterName;
    
    private Integer lessonType;
    
    @JsonIgnore
    @TableField("`index`")
    private Integer index;
    
    @ApiModelProperty(hidden = true)
    @TableField(exist = false)
    private Map<String, Object> lessonDeatiles;

    /**
     * 父章节
     */
    private Integer parent;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getCourseId() {
        return courseId;
    }

    public void setCourseId(Integer courseId) {
        this.courseId = courseId;
    }

    public String getChapterName() {
        return chapterName;
    }

    public void setChapterName(String chapterName) {
        this.chapterName = chapterName;
    }

    public Integer getParent() {
        return parent;
    }

    public void setParent(Integer parent) {
        this.parent = parent;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "Chapter{" +
        "id=" + id +
        ", courseId=" + courseId +
        ", chapterName=" + chapterName +
        ", parent=" + parent +
        ", createdBy=" + createdBy +
        ", createdTime=" + createdTime +
        ", updatedBy=" + updatedBy +
        ", updatedTime=" + updatedTime +
        ", state=" + state +
        ", delflag=" + delflag +
        "}";
    }

	public Integer getIndex() {
		return index;
	}

	public void setIndex(Integer index) {
		this.index = index;
	}

	public Map<String, Object> getLessonDetails() {
		return lessonDeatiles;
	}

	public void setLessonDetails(Map<String, Object> lessonDetails) {
		this.lessonDeatiles = lessonDetails;
	}

	public Integer getLessonType() {
		return lessonType;
	}

	public void setLessonType(Integer lessonType) {
		this.lessonType = lessonType;
	}
}
